package com.glsc.ngateway.common.api.oaflow.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @author xuchang
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class SyncPlatformFlowCommonDto<T> {

    @ApiModelProperty(value = "数据")
    List<GatewayFlowDataDto<T>> dataList;

    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    @Data
    public static class GatewayFlowDataDto<T>{

        @NotBlank
        @ApiModelProperty(value = "OA侧workFlowId")
        private String workflowId;

        @ApiModelProperty(value = "流程定义key")
        private String processDefKey;

        @ApiModelProperty(value = "节点定义key")
        private String taskDefKey;

        @ApiModelProperty(value = "流程实例id")
        private String processId;

        @ApiModelProperty(value = "节点实例id")
        private String taskId;

        @ApiModelProperty("申请人")
        private String applicant;

        @ApiModelProperty("审批人")
        private String approved;

        @ApiModelProperty(value = "表单数据")
        private T formData;
//        private Map<String, String> formData;
    }
}
